<?php
// tests/unit/UnitTestsHelper.php
/**
 * demo-zf application
 *
 * UnitTestsHelper
 *
 * @author Adam Pilacki <adam.pilacki@gmail.com>
 */
final class UnitTestsHelper
{
    public static final function bootstrap()
    {
        /**
         * Initiate app and botstrap
         * DO NOT RUN AN APP HERE YET (run causes dispatch)
         */
        $application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/../configs/application.ini');
        $bootstrap = $application->getBootstrap();
        $bootstrap->bootstrapAutoload()
            ->bootstrapRouter()
            ->bootstrapFrontController()
            ->getResource('FrontController')
                ->setParam('bootstrap', $bootstrap)
        ;

        /**
         * set proper paths for debug log files
         * (prevents tests crushing)
         */
        AdamP_Debug_Config::$lastLogFilePath = APPLICATION_PATH . '/../logs/log_last.txt';
        AdamP_Debug_Config::$allLogsFilePath = APPLICATION_PATH . '/../logs/log_all.txt';
    }
}